package com.ideaction.controller;

import com.ideaction.entity.mail.BaseMail;
import com.ideaction.entity.mail.PlayerMailData;
import com.ideaction.globalconst.Result;
import com.ideaction.req.PlayerCommonReqBody;
import com.ideaction.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 获取邮件
 *
 * @author ZGame
 */
@RestController
public class MailController {
    
    @Autowired
    private MailService mailService;
    
    @PostMapping("/GetMail")
    public String getMail(@RequestBody PlayerCommonReqBody mailReqBody) {
        Result r = Result.build();
        //		String userId = mailReqBody.getUserId();
        //		List<BaseMail> allMailist = new ArrayList<BaseMail>();
        //		PlayerMailData playerMailData = mailService.getPlayerMailData(userId);
        //		if (playerMailData != null) {
        //			//如果个人邮件数据不为空,则增加个人邮件
        //			allMailist.addAll(mailService.getPersonalMail(playerMailData));
        //		}
        //		//添加系统邮件
        //		allMailist.addAll(mailService.getSystemMail(playerMailData,mailReqBody.getParamMap()));
        //		r.put("MailList", allMailist);
        return r.response();
    }
    
}
